package com.android.camera.one.v2.initialization;

import com.android.camera.async.Updatable;
import com.android.camera.one.v2.camera2proxy.TotalCaptureResultProxy;
import com.google.common.base.Supplier;

public class MetadataUpdatable implements Updatable<TotalCaptureResultProxy> {
	private final Supplier<Boolean> mEnable;
	private final Updatable<TotalCaptureResultProxy> metadataDst;

	public MetadataUpdatable(Supplier<Boolean> enable, Updatable<TotalCaptureResultProxy> dst) {
		mEnable = enable;
		metadataDst = dst;
	}
	
	@Override
	public void update(TotalCaptureResultProxy t) {
		if (!mEnable.get()) {
			return;
		}
		metadataDst.update(t);
	}

}
